package com.jianda.commons.content;

import javax.swing.*;

/**
 * 公共弹窗
 */
public class PopContent {

    /**
     * 使用工厂设计模式
     * type: 0 info   1 warn   2 error
     * message: 消息
     */
    public static void popContent(int type, String message) {
        if (type == 0)
            JOptionPane.showMessageDialog(null, message, "提示", JOptionPane.INFORMATION_MESSAGE);
        if (type == 1)
            JOptionPane.showMessageDialog(null, message, "警告", JOptionPane.WARNING_MESSAGE);
        if (type == 2)
            JOptionPane.showMessageDialog(null, message, "错误", JOptionPane.ERROR_MESSAGE);
    }
}

